using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace MyGame
{
    public class Game1 : Microsoft.Xna.Framework.Game
    {
        GraphicsDeviceManager graphics;
        SpriteBatch spriteBatch;

        List<CModel> models = new List<CModel>();
        List<CModel> shots = new List<CModel>();

        //Camera camera;

        // Model stuff
        ModelManager modelManager;

        // Camera
        public Camera camera { get; protected set; }

        // Random
        public Random rnd { get; protected set; }

        MouseState lastMouseState;

        //Terrain terrain;

        int score = 0;
        SpriteFont scoreFont;

        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            rnd = new Random();
            graphics.PreferredBackBufferWidth = 800;
            graphics.PreferredBackBufferHeight = 600;
        }

        protected override void Initialize()
        {
            // Initialize model manager
            modelManager = new ModelManager(this);
            Components.Add(modelManager);

            base.Initialize();
        }

        // Called when the game should load its content
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);

            // Load fonts
            scoreFont = Content.Load<SpriteFont>("ScoreFont");

            lastMouseState = Mouse.GetState();
        }

        // Called when the game should update itself
        protected override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
        }

        // Called when the game should draw itself
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.Black);
            base.Draw(gameTime);
            /*
            spriteBatch.Begin();

            // Draw the current score
            string scoreText = "Score: " + score;
            spriteBatch.DrawString(scoreFont, scoreText,
                new Vector2(GraphicsDevice.Viewport.TitleSafeArea.Left,
                    GraphicsDevice.Viewport.TitleSafeArea.Top), Color.Red);

            //terrain.Draw(camera.View, camera.Projection);
            spriteBatch.End();
            */
        }
    }
}
